package com.luoqiuy.poet.controller;

import com.luoqiuy.poet.entity.Poet;
import com.luoqiuy.poet.service.iml.PoetServiceImpl;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;

@Controller
public class PoetController {

    private PoetServiceImpl poetService;

    @RequestMapping("/poet/poetInfo")
    public String poetInfo(HttpServletRequest request,int id){
        poetService.poetInfo(request,id);
        return "detail/bookInfo";
    }

    @RequestMapping("/poet/update")
    public String updateAm(HttpServletRequest request,int id){
        poetService.updateAm(request, id);
        return "detail/editPoet";
    }

    @RequestMapping("/poet/updatePm")
    public String updatePm(HttpServletRequest request, Poet poet){
        poetService.updatePm(request, poet);
        return "detail/bookDetail";
    }
}
